﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QUANLYVATTU
{
    class HOADONDAL
    {
                public HOADONDAL()
        {

        }
                public void ThemHoaDon(string sohd, string mahang, double soluong, double dongia, double trigia, double khuyenmai, string diengiai)
        {
            SqlConnection conn = new SqlConnection();
            conn.ConnectionString = @"Data Source=QUYNHUYEN\SQLEXPRESS;Initial Catalog=QLVT; User Id=sa; Password=sa";
            conn.Open();
            SqlCommand cmd = new SqlCommand("insert into hoadon values ('" + sohd + "','" + mahang + "'," + soluong.ToString() + "," + dongia.ToString() + "," + trigia.ToString() + "," + khuyenmai.ToString() + ",'" + diengiai + "')", conn);
            cmd.ExecuteNonQuery();
            conn.Close();
        }

    }
}
